#include<stdio.h>
#include<conio.h>
#include<graphics.h>

int main()
{
	
	float Pi = 3.14159;
	initgraph(1200, 800);
	setbkcolor(RGB(128,128,128));
	cleardevice();

	int centerX=300;
	int centerY=300;
	int radius = 200;
	
	int left=centerX-radius;
	int top=centerY-radius;
	int right=centerX+radius;
	int bottom=centerY+radius;

	int i,j;
	float offset=0;
	float totaloffset=0;

	while(1)
	{
		for(centerX=200;centerX<=1000;centerX=centerX+400)
		for(centerY=200;centerY<=600;centerY=centerY+400)
		{
			totaloffset=0;
			float h=rand()%180;
			COLORREF color1=HSVtoRGB(h,0.9,0.8);
			COLORREF color2=HSVtoRGB(h+180,0.9,0.8);
			for(radius=200;radius>0;radius=radius-50)

	{
		int left=centerX-radius;
		int top=centerY-radius;
		int right=centerX+radius;
		int bottom=centerY+radius;
		for(i=0;i<20;i++)
			
	{
		offset=i*Pi/10+totaloffset;
		setfillcolor(color1);
	solidpie(left,top,right,bottom,offset,offset+2*Pi/60);
	setfillcolor(RGB(255,255,255));
	solidpie(left,top,right,bottom,offset+2*Pi/60,offset+3*Pi/60);
	setfillcolor(color2);
	solidpie(left,top,right,bottom,offset+3*Pi/60,offset+5*Pi/60);
	setfillcolor(RGB(0,0,0));
	solidpie(left,top,right,bottom,offset+5*Pi/60,offset+6*Pi/60);

	
	}
	
	totaloffset=totaloffset+Pi/20;
	}
		
	}
		_getch();
	}
	_getch();
	
	return 0;
}